#include "main.h"
#include "planning_base.h"
#include "car.h"
#include "scene_base.h"
#include "scene_straight.h"
#include "scene_obs_pass.h"

bool Process(const int& type) {
    switch (type) {
        case PlanType::StraightStopObsType: {
            std::unique_ptr<SceneBase> planning_obj = std::make_unique<StraightStopObs>();
            return planning_obj->Planning_process();
        }
        case PlanType::StraightStationType: {
            std::unique_ptr<SceneBase> planning_obj = std::make_unique<StraightStation>();
            return planning_obj->Planning_process();
        }
        case PlanType::StraightFollowType: {
            std::unique_ptr<SceneBase> planning_obj = std::make_unique<StraightFollow>();
            return planning_obj->Planning_process();
        }
        case PlanType::StraightCrosswalkType: {
            std::unique_ptr<SceneBase> planning_obj = std::make_unique<StraightCrosswalk>();
            return planning_obj->Planning_process();
        }
        case PlanType::ObsPassStaticType: {
            std::unique_ptr<SceneBase> planning_obj = std::make_unique<ObsPassStatic>();
            return planning_obj->Planning_process();
        }
        default:
            break;
    }
    return false;
}

int main() {

    // 打开窗口
    initgraph(SWIDTH, SHEIGHT, EW_SHOWCONSOLE);
    setbkcolor(WHITE); // 设置背景颜色
    cleardevice();

    if (Process(PlanType::StraightStopObsType)) {
        std::cout << "complete" << std::endl;
    }

    system("pause");
    closegraph();
    return 0;
}

